$dir = $args[0]
$exclude = $args[1]

Write-Debug ("Working copy generating at {0}..." -f $Params.TempBuildDir)
.\Tasks\getWorkingCopy.ps1 $dir $Params.TempBuildDir
Write-Debug "Working copy generated"

if($exclude) { 
	$temp = $exclude.split(";");
	Write-Debug "Excluding '$temp'..."
	.\Tasks\removeItems.ps1 $Params.TempBuildDir $temp
	Write-Debug "Exlcuding paths done"
}

Write-Debug ("Remove source control bindings from {0}" -f $Params.TempBuildDir)
.\Tasks\removeSourceControlBinding.ps1 $Params.TempBuildDir
Write-Debug "Source control bindings removed"